/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.poss.api.domain;

import java.util.List;
import javax.persistence.*;

/**
 *
 * @author sampath
 */
@Entity
public class Customer {
    private long customerId;
    private String customerName;
    private String customerNic;
    private String customerPhone;
    private String customerAddres;
    private double customerAmount;
    private List<Sale> customerSales;

    @OneToMany(targetEntity=Sale.class, mappedBy="broughtCustomer", cascade=CascadeType.ALL, fetch=FetchType.LAZY) 
    public List<Sale> getCustomerSales() {
        return customerSales;
    }

    public void setCustomerSales(List<Sale> customerSales) {
        this.customerSales = customerSales;
    }
    public String getCustomerAddres() {
        return customerAddres;
    }

    public void setCustomerAddres(String customerAddres) {
        this.customerAddres = customerAddres;
    }

    public double getCustomerAmount() {
        return customerAmount;
    }

    public void setCustomerAmount(double customerAmount) {
        this.customerAmount = customerAmount;
    }

    @Id
    @GeneratedValue
    public long getCustomerId() {
        return customerId;
    }

    public void setCustomerId(long customerId) {
        this.customerId = customerId;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }

    public String getCustomerNic() {
        return customerNic;
    }

    public void setCustomerNic(String customerNic) {
        this.customerNic = customerNic;
    }

    public String getCustomerPhone() {
        return customerPhone;
    }

    public void setCustomerPhone(String customerPhone) {
        this.customerPhone = customerPhone;
    }
       
    
}
